package org.squarecap.apps.eventcompanion.domain;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;
import javax.validation.constraints.NotNull;
import java.util.Date;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Future;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.ManyToMany;

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class Congreso {

    /**
     */
    @NotNull
    private String titulo;

    /**
     */
    private String urlLogo;

    /**
     */
    private String urlSede;

    /**
     */
    private String direccionSede;

    /**
     */
    @Future
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date inicioActividades;

    /**
     */
    @Future
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date cierreActividades;

    /**
     */
    @Min(0L)
    private int cupoMax;

    /**
     */
    private String urlWeb;

    /**
     */
    private String usuarioTwitter;

    /**
     */
    private String descripcion;

    /**
     */
    @ManyToMany(cascade = CascadeType.ALL)
    private Set<Participante> participantes = new HashSet<Participante>();
}
